#include <stdio.h>
#include <string.h>

int getUniqueCharCount(char *str)
{
    int count[256] = {0};
    int uniqueCount = 0;

    for (int i = 0; str[i]; i++)
    {
        if (str[i] != '\n' && str[i] != '\0')
        {
            if (count[(unsigned char)str[i]] == 0)
            {
                uniqueCount++;
            }
            count[(unsigned char)str[i]]++;
        }
    }

    return uniqueCount;
}

int main()
{
    char str[256];

    printf("请输入一个字符串：");
    if (scanf("%255s", str) == 1)
    {
        printf("不同字符的个数：%d\n", getUniqueCharCount(str));
    }
    else
    {
        printf("读取输入时出错。\n");
    }

    return 0;
}